import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import './plugins/element.js'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

// 引入滑动验证功能
import SlideVerify from 'vue-monoplasty-slide-verify'

// 全局css
import './assets/css/global.css'

// 引入axios
import axios from 'axios'

// 引入echarts
import * as echarts from 'echarts'
Vue.use(SlideVerify)
Vue.prototype.$echarts = echarts

axios.defaults.baseURL = 'http://121.196.196.196:8085/'
// axios.defaults.baseURL = 'http://192.168.43.3:8085/'
axios.interceptors.request.use(config => {
  // console.log(config)
  // 使用拦截器将每次请求头中放入token值
  // config.headers.Authorization = window.sessionStorage.getItem('token')
  config.headers.token = window.sessionStorage.getItem('token')
  // 在最后必须 return config
  return config
})
Vue.prototype.$http = axios

// 全局引入ElementUI
Vue.use(ElementUI)

// 更改全局message弹窗变为elementUI的Message组件
Vue.prototype.$message = ElementUI.Message

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
